home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / MPW Oberon 2.1168 / OInterfaces / OCE.mod < prev    next >
Encoding:
Text File  |  1995-08-10  |  45.6 KB  |  1,195 lines  |  [TEXT/MPS ]

  1. (*
  2.      File:        OCE.mod
  3.  
  4.      Contains:    Apple Open Collaboration Environment (AOCE) Interfaces.
  5.  
  6.      Version:    Technology:    AOCE Toolbox 1.02
  7.                  Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs.applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. *)
  19.  
  20. (*$TAGS-*)
  21. (*$CALLING PASCAL*)
  22. MODULE OCE;
  23.  
  24. IMPORT SYSTEM, Types, Aliases, AppleEvents;
  25.  
  26. (* $PUSH*)
  27. (* $ALIGN MAC68K*)
  28. (* $LibExport+*)
  29.  
  30. CONST
  31.     kOCECopyCreationID*            = 768;
  32.     kOCECopyDirDiscriminator*    = 769;
  33.     kOCECopyLocalRecordID*        = 770;
  34.     kOCECopyPackedDSSpec*        = 771;
  35.     kOCECopyPackedPathName*        = 772;
  36.     kOCECopyPackedRLI*            = 773;
  37.     kOCECopyPackedRecordID*        = 774;
  38.     kOCECopyRLI*                    = 775;
  39.     kOCECopyRString*                = 776;
  40.     kOCECopyRecordID*            = 777;
  41.     kOCECopyShortRecordID*        = 778;
  42.     kOCEDuplicateRLI*            = 779;
  43.     kOCEEqualCreationID*            = 780;
  44.     kOCEEqualDirDiscriminator*    = 781;
  45.     kOCEEqualDSSpec*                = 782;
  46.     kOCEEqualLocalRecordID*        = 783;
  47.     kOCEEqualPackedDSSpec*        = 784;
  48.     kOCEEqualPackedPathName*        = 785;
  49.     kOCEEqualPackedRecordID*        = 786;
  50.     kOCEEqualPackedRLI*            = 787;
  51.     kOCEEqualRecordID*            = 788;
  52.     kOCEEqualRLI*                = 789;
  53.     kOCEEqualRString*            = 790;
  54.     kOCEEqualShortRecordID*        = 791;
  55.     kOCEExtractAlias*            = 792;
  56.     kOCEGetDSSpecInfo*            = 793;
  57.     kOCEGetIndAttributeType*        = 794;
  58.     kOCEGetIndRecordType*        = 795;
  59.     kOCEGetXtnType*                = 796;
  60.     kOCEIsNullPackedPathName*    = 797;
  61.     kOCENewLocalRecordID*        = 798;
  62.     kOCENewRLI*                    = 799;
  63.     kOCENewRecordID*                = 800;
  64.     kOCENewShortRecordID*        = 801;
  65.     kOCEPackDSSpec*                = 802;
  66.     kOCEPackPathName*            = 803;
  67.     kOCEPackRLI*                    = 804;
  68.     kOCEPackRLIParts*            = 805;
  69.     kOCEPackRecordID*            = 806;
  70.     kOCEPackedDSSpecSize*        = 807;
  71.     kOCEPackedPathNameSize*        = 808;
  72.     kOCEPackedRLIPartsSize*        = 809;
  73.     kOCEPackedRLISize*            = 810;
  74.     kOCEPackedRecordIDSize*        = 811;
  75.     kOCEDNodeNameCount*            = 812;
  76.     kOCERelRString*                = 813;
  77.     kOCESetCreationIDtoNull*        = 814;
  78.     kOCEUnpackDSSpec*            = 815;
  79.     kOCEUnpackPathName*            = 816;
  80.     kOCEUnpackRLI*                = 817;
  81.     kOCEUnpackRecordID*            = 818;
  82.     kOCEValidPackedDSSpec*        = 819;
  83.     kOCEValidPackedPathName*        = 820;
  84.     kOCEValidPackedRecordID*        = 821;
  85.     kOCEValidPackedRLI*            = 822;
  86.     kOCEValidRLI*                = 823;
  87.     kOCEValidRString*            = 824;
  88.     kOCECToRString*                = 825;
  89.     kOCEPToRString*                = 826;
  90.     kOCERToPString*                = 827;
  91.     kOCEPathFinderCID*            = 828;
  92.     kOCEStreamPackedDSSpec*        = 829;
  93.     kOCENullCID*                    = 836;
  94.     kOCEGetAccessControlDSSpec*    = 837;
  95.     kOCEGetRootPackedRLI*        = 838;
  96.  
  97.     
  98. TYPE
  99.     OCERecordTypeIndex* = INTEGER;
  100.  
  101.     OCEAttributeTypeIndex* = INTEGER;
  102.  
  103. (* For anyone who absolutely needs a define of the body of the standard record or
  104. attribute type, use these below.  CAUTION!  All the types below are assumed to be
  105. in character set 'smRoman'.  If you try to compare these to some RString or
  106. AttributeType variable, you must take the character set code into account.  Future
  107. standard types may be defined using character sets other than 'smRoman'. *)
  108.  
  109. CONST
  110.     kUserRecTypeNum*                = 1;                            (* "User" *)
  111.     kGroupRecTypeNum*            = 2;                            (* "Group" *)
  112.     kMnMRecTypeNum*                = 3;                            (* "AppleMail™ M&M" *)
  113.     kMnMForwarderRecTypeNum*        = 4;                            (* "AppleMail™ Fwdr" *)
  114.     kNetworkSpecRecTypeNum*        = 5;                            (* "NetworkSpec" *)
  115.     kADAPServerRecTypeNum*        = 6;                            (* "ADAP Server" *)
  116.     kADAPDNodeRecTypeNum*        = 7;                            (* "ADAP DNode" *)
  117.     kADAPDNodeRepRecTypeNum*        = 8;                            (* "ADAP DNode Rep" *)
  118.     kServerSetupRecTypeNum*        = 9;                            (* "Server Setup" *)
  119.     kDirectoryRecTypeNum*        = 10;                            (* "Directory" *)
  120.     kDNodeRecTypeNum*            = 11;                            (* "DNode" *)
  121.     kSetupRecTypeNum*            = 12;                            (* "Setup" *)
  122.     kMSAMRecTypeNum*                = 13;                            (* "MSAM" *)
  123.     kDSAMRecTypeNum*                = 14;                            (* "DSAM" *)
  124.     kAttributeValueRecTypeNum*    = 15;                            (* "Attribute Value" *)
  125.     kBusinessCardRecTypeNum*        = 16;                            (* "Business Card" *)
  126.     kMailServiceRecTypeNum*        = 17;                            (* "Mail Service" *)
  127.     kCombinedRecTypeNum*            = 18;                            (* "Combined" *)
  128.     kOtherServiceRecTypeNum*        = 19;                            (* "Other Service" *)
  129.     kAFPServiceRecTypeNum*        = 20;                            (* "Other Service afps" *)
  130.     kFirstOCERecTypeNum*            = kUserRecTypeNum;                (* first standard OCE record type *)
  131.     kLastOCERecTypeNum*            = kAFPServiceRecTypeNum;        (* last standard OCE record type *)
  132.     kNumOCERecTypes*                = kLastOCERecTypeNum - kFirstOCERecTypeNum + 1;
  133.  
  134. (* Indices for the standard definitions for certain attribute types (OCEAttributeTypeIndex): *)
  135.     kMemberAttrTypeNum*            = 1001;                            (* "Member" *)
  136.     kAdminsAttrTypeNum*            = 1002;                            (* "Administrators" *)
  137.     kMailSlotsAttrTypeNum*        = 1003;                            (* "mailslots" *)
  138.     kPrefMailAttrTypeNum*        = 1004;                            (* "pref mailslot" *)
  139.     kAddressAttrTypeNum*            = 1005;                            (* "Address" *)
  140.     kPictureAttrTypeNum*            = 1006;                            (* "Quickdraw.Picture" *)
  141.     kAuthKeyAttrTypeNum*            = 1007;                            (* "auth key" *)
  142.     kTelephoneAttrTypeNum*        = 1008;                            (* "Telephone" *)
  143.     kNBPNameAttrTypeNum*            = 1009;                            (* "NBP Name" *)
  144.     kQMappingAttrTypeNum*        = 1010;                            (* "ForwarderQMap" *)
  145.     kDialupSlotAttrTypeNum*        = 1011;                            (* "DialupSlotInfo" *)
  146.     kHomeNetAttrTypeNum*            = 1012;                            (* "Home Internet" *)
  147.     kCoResAttrTypeNum*            = 1013;                            (* "Co-resident M&M" *)
  148.     kFwdrLocalAttrTypeNum*        = 1014;                            (* "FwdrLocalRecord" *)
  149.     kConnectAttrTypeNum*            = 1015;                            (* "Connected To" *)
  150.     kForeignAttrTypeNum*            = 1016;                            (* "Foreign RLIs" *)
  151.     kOwnersAttrTypeNum*            = 1017;                            (* "Owners" *)
  152.     kReadListAttrTypeNum*        = 1018;                            (* "ReadList" *)
  153.     kWriteListAttrTypeNum*        = 1019;                            (* "WriteList" *)
  154.     kDescriptorAttrTypeNum*        = 1020;                            (* "Descriptor" *)
  155.     kCertificateAttrTypeNum*        = 1021;                            (* "Certificate" *)
  156.     kMsgQsAttrTypeNum*            = 1022;                            (* "MessageQs" *)
  157.     kPrefMsgQAttrTypeNum*        = 1023;                            (* "PrefMessageQ" *)
  158.     kMasterPFAttrTypeNum*        = 1024;                            (* "MasterPF" *)
  159.     kMasterNetSpecAttrTypeNum*    = 1025;                            (* "MasterNetSpec" *)
  160.     kServersOfAttrTypeNum*        = 1026;                            (* "Servers Of" *)
  161.     kParentCIDAttrTypeNum*        = 1027;                            (* "Parent CID" *)
  162.     kNetworkSpecAttrTypeNum*        = 1028;                            (* "NetworkSpec" *)
  163.     kLocationAttrTypeNum*        = 1029;                            (* "Location" *)
  164.     kTimeSvrTypeAttrTypeNum*        = 1030;                            (* "TimeServer Type" *)
  165.     kUpdateTimerAttrTypeNum*        = 1031;                            (* "Update Timer" *)
  166.     kShadowsOfAttrTypeNum*        = 1032;                            (* "Shadows Of" *)
  167.     kShadowServerAttrTypeNum*    = 1033;                            (* "Shadow Server" *)
  168.     kTBSetupAttrTypeNum*            = 1034;                            (* "TB Setup" *)
  169.     kMailSetupAttrTypeNum*        = 1035;                            (* "Mail Setup" *)
  170.     kSlotIDAttrTypeNum*            = 1036;                            (* "SlotID" *)
  171.     kGatewayFileIDAttrTypeNum*    = 1037;                            (* "Gateway FileID" *)
  172.     kMailServiceAttrTypeNum*        = 1038;                            (* "Mail Service" *)
  173.     kStdSlotInfoAttrTypeNum*        = 1039;                            (* "Std Slot Info" *)
  174.     kAssoDirectoryAttrTypeNum*    = 1040;                            (* "Asso. Directory" *)
  175.     kDirectoryAttrTypeNum*        = 1041;                            (* "Directory" *)
  176.     kDirectoriesAttrTypeNum*        = 1042;                            (* "Directories" *)
  177.     kSFlagsAttrTypeNum*            = 1043;                            (* "SFlags" *)
  178.     kLocalNameAttrTypeNum*        = 1044;                            (* "Local Name" *)
  179.     kLocalKeyAttrTypeNum*        = 1045;                            (* "Local Key" *)
  180.     kDirUserRIDAttrTypeNum*        = 1046;                            (* "Dir User RID" *)
  181.     kDirUserKeyAttrTypeNum*        = 1047;                            (* "Dir User Key" *)
  182.     kDirNativeNameAttrTypeNum*    = 1048;                            (* "Dir Native Name" *)
  183.     kCommentAttrTypeNum*            = 1049;                            (* "AIFF.Comment" *)
  184.     kRealNameAttrTypeNum*        = 1050;                            (* "Real Name" *)
  185.     kPrivateDataAttrTypeNum*        = 1051;                            (* "Private Data" *)
  186.     kDirTypeAttrTypeNum*            = 1052;                            (* "Directory Type" *)
  187.     kDSAMFileAliasAttrTypeNum*    = 1053;                            (* "DSAM File Alias" *)
  188.     kCanAddressToAttrTypeNum*    = 1054;                            (* "Can Address To" *)
  189.     kDiscriminatorAttrTypeNum*    = 1055;                            (* "Discriminator" *)
  190.     kAliasAttrTypeNum*            = 1056;                            (* "Alias" *)
  191.     kParentMSAMAttrTypeNum*        = 1057;                            (* "Parent MSAM" *)
  192.     kParentDSAMAttrTypeNum*        = 1058;                            (* "Parent DSAM" *)
  193.     kSlotAttrTypeNum*            = 1059;                            (* "Slot" *)
  194.     kAssoMailServiceAttrTypeNum*    = 1060;                            (* "Asso. Mail Service" *)
  195.     kFakeAttrTypeNum*            = 1061;                            (* "Fake" *)
  196.     kInheritSysAdminAttrTypeNum*    = 1062;                            (* "Inherit SysAdministrators" *)
  197.     kPreferredPDAttrTypeNum*        = 1063;                            (* "Preferred PD" *)
  198.     kLastLoginAttrTypeNum*        = 1064;                            (* "Last Login" *)
  199.     kMailerAOMStateAttrTypeNum*    = 1065;                            (* "Mailer AOM State" *)
  200.     kMailerSendOptionsAttrTypeNum* = 1066;                        (* "Mailer Send Options" *)
  201.     kJoinedAttrTypeNum*            = 1067;                            (* "Joined" *)
  202.     kUnconfiguredAttrTypeNum*    = 1068;                            (* "Unconfigured" *)
  203.     kVersionAttrTypeNum*            = 1069;                            (* "Version" *)
  204.     kLocationNamesAttrTypeNum*    = 1070;                            (* "Location Names" *)
  205.     kActiveAttrTypeNum*            = 1071;                            (* "Active" *)
  206.     kDeleteRequestedAttrTypeNum*    = 1072;                            (* "Delete Requested" *)
  207.     kGatewayTypeAttrTypeNum*        = 1073;                            (* "Gateway Type" *)
  208.     kFirstOCEAttrTypeNum*        = kMemberAttrTypeNum;            (* first standard OCE attr type *)
  209.     kLastOCEAttrTypeNum*            = kGatewayTypeAttrTypeNum;        (* last standard OCE attr type *)
  210.     kNumOCEAttrTypes*            = kLastOCEAttrTypeNum - kFirstOCEAttrTypeNum + 1;
  211.  
  212. (* Miscellaneous enums*: *)
  213.     kRString32Size*                = 32;                            (* max size of the body field in RString32 *)
  214.     kRString64Size*                = 64;                            (* max size of the body field in RString64 *)
  215.     kNetworkSpecMaxBytes*        = 32;                            (* max size of the body field in NetworkSpec *)
  216.     kPathNameMaxBytes*            = 1024;                            (* max size of the data field in PackedPathName *)
  217.     kDirectoryNameMaxBytes*        = 32;                            (* max size of the body field in DirectoryName *)
  218.     kAttributeTypeMaxBytes*        = 32;                            (* max size of the body field in AttributeType *)
  219.     kAttrValueMaxBytes*            = 65536;                        (* max size of any attribute value *)
  220.     kRStringMaxBytes*            = 256;                            (* max size (in bytes) of the body field of a recordName or recordType *)
  221.     kRStringMaxChars*            = 128;                            (* max size (in chars) of the body field of a recordName or recordType *)
  222.  
  223.     kNULLDNodeNumber*            = 0;                            (* Special value meaning none specified *)
  224.     kRootDNodeNumber*            = 2;                            (* DNodeNum corresponding to the root of the tree *)
  225.  
  226. (* This enum is used to select the kind of RString in calls such as OCERelRString,
  227. OCEEqualRString, and OCEValidRString.
  228.  
  229. eGenericSensitive and eGenericInsensitive are enumerators that can be used if you
  230. use RStrings for things other than what you see in this file.  If you want them to
  231. be compared in a case- and diacritical-sensitive manner (c ≠ C ≠ ç), use
  232. eGenericSensitive.  If you want them to be compared in a case- and diacritical-
  233. insensitive manner (c* = C* = ç), use eGenericInensitive.
  234. WARNING:  do not use eGenericSensitive and eGenericInsensitive with catalog
  235. names, entity names, pathname parts, entity types, network specs, or attribute
  236. types!  Don't assume that you know how they should be compared!!! *)
  237.     kOCEDirName*                    = 0;
  238.     kOCERecordOrDNodeName*        = 1;
  239.     kOCERecordType*                = 2;
  240.     kOCENetworkSpec*                = 3;
  241.     kOCEAttrType*                = 4;
  242.     kOCEGenericSensitive*        = 5;
  243.     kOCEGenericInsensitive*        = 6;
  244.  
  245.     
  246. TYPE
  247.     RStringKind* = INTEGER;
  248.  
  249. (* Values for the signature field in Discriminator *)
  250.  
  251. CONST
  252.     kDirAllKinds*                = 0;
  253.     kDirADAPKind*                = LONG("adap");
  254.     kDirPersonalDirectoryKind*    = LONG("pdir");
  255.     kDirDSAMKind*                = LONG("dsam");
  256.  
  257.     
  258. TYPE
  259.     OCEDirectoryKind* = LONGINT;
  260.  
  261. (* Values returned by GetDSSpecInfo() *)
  262.  
  263. CONST
  264.     kOCEInvalidDSSpec*            = $3F3F3F3F;                    (* could not be determined *)
  265.     kOCEDirsRootDSSpec*            = LONG("root");                        (* root of all catalogs ("Catalogs" icon) *)
  266.     kOCEDirectoryDSSpec*            = LONG("dire");                        (* catalog *)
  267.     kOCEDNodeDSSpec*                = LONG("dnod");                        (* d-node *)
  268.     kOCERecordDSSpec*            = LONG("reco");                        (* record *)
  269.     kOCEentnDSSpec*                = LONG("entn");                        (* extensionType is LONG("entn") *)
  270.     kOCENOTentnDSSpec*            = LONG("not ");
  271.  
  272. (* Values for AttributeTag *)
  273.     typeRString*                    = LONG("rstr");
  274.     typePackedDSSpec*            = LONG("dspc");
  275.     typeBinary*                    = LONG("bnry");
  276.  
  277. (* Bit flag corresponding to the canContainRecords bit.  Use it like this*:
  278.     if (foo & kCanContainRecords)
  279.         then this dNode can contain records!
  280. kForeignNode is used to indicate nodes in the name hierarchy that correspond to
  281. foreign catalogs (meaning ADAP sees no clusters or DNodes beneath it, but
  282. mail routers might be able to route to clusters beneath it. *)
  283.     kCanContainRecordsBit*        = 0;
  284.     kForeignNodeBit*                = 1;
  285.  
  286. (* DirNodeKind *)
  287.     kCanContainRecords*            = ASH(1,kCanContainRecordsBit);
  288.     kForeignNode*                = ASH(1,kForeignNodeBit);
  289.  
  290.     
  291. TYPE
  292.     DirNodeKind* = LONGINT;
  293.  
  294. (**** Toolbox Control ****)
  295. (* We will have a version number and attributes for toolboxes off the aa5e trap
  296. and the S&F server trap.
  297.  
  298. This includes the OCE toolbox and S&F Server.  [Note: the S&F server will
  299. change to ONLY service ServerGateway calls —it will then be necessary to run
  300. it co–resident with an OCE toolbox].
  301.  
  302. The high order word will represent the S&F Server version number.  The low
  303. order word will represent the OCE toolbox version number.  These will be zero
  304. until the component is up and running.  It is not possible to know these
  305. a–priori. Note*: there will not be a seperate version numbers for each component
  306. in the OCE toolbox or S&F server.
  307.  
  308. The above is consistent with the standard System 7.0 usage of Gestalt.
  309.  
  310. The oce tb attribute gestaltOCETBPresent implies the existence of OCE on a
  311. machine.
  312.  
  313. The OCE TB attribute gestaltOCETBAvailable implies the availablity of OCE calls.
  314.  
  315. The attribute gestaltOCESFServerAvailable implies the availablity of OCE calls
  316. available through the S&F server. This are essentially the server gateway calls.
  317.  
  318. Any (future) remaining OCE attributes may not be established correctly until
  319. the attribute gestaltOCETBAvailable is set.
  320.  
  321. The gestalt selectors and values are listed below*: *)
  322.  
  323. CONST
  324.     gestaltOCEToolboxVersion*    = LONG("ocet");                        (* OCE Toolbox version *)
  325.     gestaltOCEToolboxAttr*        = LONG("oceu");
  326.  
  327. (* version includes*:
  328.  *  dirtb
  329.  *  authtb
  330.  *  mailtb
  331.  *  ipmtb
  332.  *  personal catalog
  333.  *  ADSPSecure
  334.  * e.g. all interfaces dependent on the aa5e trap. *)
  335.     gestaltOCETB*                = $0102;                        (* OCE Toolbox version 1.02 *)
  336.     gestaltSFServer*                = $0100;                        (* S&F Server version 1.0 *)
  337.     gestaltOCETBPresent*            = $01;                            (* OCE toolbox is present, not running *)
  338.     gestaltOCETBAvailable*        = $02;                            (* OCE toolbox is running and available *)
  339.     gestaltOCESFServerAvailable*    = $04;                            (* S&F Server is running and available *)
  340.     gestaltOCETBNativeGlueAvailable* = $10;                        (* Native PowerPC Glue routines are availible *)
  341.  
  342. (*    Constants used for Transitions. *)
  343.     ATTransIPMStart*                = LONG("ipms");
  344.     ATTransIPMShutdown*            = LONG("ipmd");
  345.     ATTransDirStart*                = LONG("dirs");
  346.     ATTransDirShutdown*            = LONG("dird");
  347.     ATTransAuthStart*            = LONG("auts");
  348.     ATTransAuthShutdown*            = LONG("autd");
  349.     ATTransSFStart*                = LONG("s&fs");
  350.     ATTransSFShutdown*            = LONG("s&fd");
  351.  
  352. (* Some definitions for time-related parameters*: *)
  353. (* Interpreted as UTC seconds since 1/1/1904 *)
  354.     
  355. TYPE
  356.     UTCTime* = LONGINT;
  357.  
  358. (* seconds EAST of Greenwich *)
  359.     UTCOffset* = LONGINT;
  360.  
  361. (* This is the same as the ScriptManager script. *)
  362.     CharacterSet* = INTEGER;
  363.  
  364. (**** RString ****)
  365. (* struct RString is a maximum-sized structure.  Allocate one of these and it will
  366. hold any valid RString. *)
  367.     RString* = RECORD
  368.         charSet*:                CharacterSet;
  369.         dataLength*:                INTEGER;
  370.         body*:                    ARRAY (*ΔΔ[0..*)kRStringMaxBytes(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *) (* place for characters *)
  371.     END;
  372.  
  373. (* struct ProtoRString is a minimum-sized structure.  Use this for a variable-length RString. *)
  374.     ProtoRString* = RECORD
  375.         charSet*:                CharacterSet;
  376.         dataLength*:                INTEGER;
  377.     END;
  378.  
  379.     RStringPtr* = POINTER TO RString;
  380.     RStringHandle* = HANDLE TO RString (*ΔΔ POINTER TO RStringPtr*);
  381.  
  382.     ProtoRStringPtr* = POINTER TO ProtoRString;
  383.  
  384.     RString64* = RECORD
  385.         charSet*:                CharacterSet;
  386.         dataLength*:                INTEGER;
  387.         body*:                    ARRAY (*ΔΔ[0..*)kRString64Size(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *)
  388.     END;
  389.  
  390.     RString32* = RECORD
  391.         charSet*:                CharacterSet;
  392.         dataLength*:                INTEGER;
  393.         body*:                    ARRAY (*ΔΔ[0..*)kRString32Size(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *)
  394.     END;
  395.  
  396. (* Standard definitions for the entity type field and attribute type
  397. have been moved to the end of the file. *)
  398. (* Copies str1 to str2.  str2Length is the size of str2, excluding header.
  399. A memFull error will be returned if that is not as large as str1->dataLength. *)
  400.  
  401. PROCEDURE OCECopyRString*((*CONST*)VAR str1: RString; VAR str2: RString; str2Length: INTEGER): Types.OSErr;
  402.     (*$IF NOT GENERATINGCFM*)
  403.     INLINE PASCAL $303C, 776, $AA5C;
  404.     (*$END*)
  405. (*    Make an RString from a C string.  If the c string is bigger than rStrLength,
  406. only rStrLength bytes will be copied. (rStrLength does not include the header size) *)
  407. PROCEDURE OCECToRString*(cStr: Types.ConstCStringPtr; charSet: CharacterSet; VAR rStr: RString; rStrLength: INTEGER);
  408.     (*$IF NOT GENERATINGCFM*)
  409.     INLINE PASCAL $303C, 825, $AA5C;
  410.     (*$END*)
  411. (*    Make an RString from a Pascal string.  If the Pascal string is bigger than rStrLength,
  412. only rStrLength bytes will be copied. (rStrLength does not include the header size) *)
  413. PROCEDURE OCEPToRString*(pStr: Types.ConstStr255Param; charSet: CharacterSet; VAR rStr: RString; rStrLength: INTEGER);
  414.     (*$IF NOT GENERATINGCFM*)
  415.     INLINE PASCAL $303C, 826, $AA5C;
  416.     (*$END*)
  417. (*    Make a Pascal string from an RString.  It's up to you to check the char set of
  418. the RString, or if the length of the RString is greater than 255 (the Pascal string's
  419. length will simply be the lower byte of the RString's length).  The Types.StringPtr that is
  420. returned will point directly into the RString (no memory will be allocated). *)
  421. PROCEDURE OCERToPString*((*CONST*)VAR rStr: RString): Types.StringPtr;
  422.     (*$IF NOT GENERATINGCFM*)
  423.     INLINE PASCAL $303C, 827, $AA5C;
  424.     (*$END*)
  425. (*    Check the relative equality of two RStrings.  Determines if str1 is greater than,
  426. equal to, or less than str2.  Result types for OCERelRString are defined in <OSUtils.h>
  427. (same as for RelString). *)
  428. PROCEDURE OCERelRString*(str1: (*ΔΔUNIVΔΔ*) Types.Ptr; str2: (*ΔΔUNIVΔΔ*) Types.Ptr; kind: RStringKind): INTEGER;
  429.     (*$IF NOT GENERATINGCFM*)
  430.     INLINE PASCAL $303C, 813, $AA5C;
  431.     (*$END*)
  432. (*    Check for equality of two RStrings. Returns true if equal. *)
  433. PROCEDURE OCEEqualRString*(str1: (*ΔΔUNIVΔΔ*) Types.Ptr; str2: (*ΔΔUNIVΔΔ*) Types.Ptr; kind: RStringKind): BOOLEAN;
  434.     (*$IF NOT GENERATINGCFM*)
  435.     INLINE PASCAL $303C, 790, $AA5C;
  436.     (*$END*)
  437. (*    Check the validity of an RString.  Returns true if the RString is valid *)
  438. PROCEDURE OCEValidRString*(str: (*ΔΔUNIVΔΔ*) Types.Ptr; kind: RStringKind): BOOLEAN;
  439.     (*$IF NOT GENERATINGCFM*)
  440.     INLINE PASCAL $303C, 824, $AA5C;
  441.     (*$END*)
  442. (**** CreationID ****)
  443.  
  444. TYPE
  445.     CreationID* = RECORD
  446.         source*:                    LONGINT;                                (* Fields definitions and usage are not defined *)
  447.         seq*:                    LONGINT;
  448.     END;
  449.  
  450.     AttributeCreationID* = CreationID;
  451.  
  452. (* Returns a pointer to a null CreationID . *)
  453.  
  454. (*•• PROCEDURE OCENullCID*(): CreationID;
  455.     (*$IF NOT GENERATINGCFM*)
  456.     INLINE PASCAL $303C, 836, $AA5C;
  457.     (*$END*)*)
  458. (* Returns a pointer to a special CreationID used within the PathFinder. *)
  459. (*•• PROCEDURE OCEPathFinderCID*(): CreationID;
  460.     (*$IF NOT GENERATINGCFM*)
  461.     INLINE PASCAL $303C, 828, $AA5C;
  462.     (*$END*)*)
  463. (* Sets the CreationID to a null value. *)
  464. PROCEDURE OCESetCreationIDtoNull*(VAR cid: CreationID);
  465.     (*$IF NOT GENERATINGCFM*)
  466.     INLINE PASCAL $303C, 814, $AA5C;
  467.     (*$END*)
  468. (* Copies the value of cid1 to cid2. *)
  469. PROCEDURE OCECopyCreationID*((*CONST*)VAR cid1: CreationID; VAR cid2: CreationID);
  470.     (*$IF NOT GENERATINGCFM*)
  471.     INLINE PASCAL $303C, 768, $AA5C;
  472.     (*$END*)
  473. (* Check the equality of two CreationIDs. *)
  474. PROCEDURE OCEEqualCreationID*((*CONST*)VAR cid1: CreationID; (*CONST*)VAR cid2: CreationID): BOOLEAN;
  475.     (*$IF NOT GENERATINGCFM*)
  476.     INLINE PASCAL $303C, 780, $AA5C;
  477.     (*$END*)
  478. (**** NetworkSpec ****)
  479. (* For the record, a NetworkSpec is an RString with a smaller maximum size.
  480. I don't just typedef it to an RString, because I want the definition of the NetworkSpec
  481. struct to contain the max length.  But it should be possible to typecast any
  482. NetworkSpec to an RString and use all the RString utilities on it. *)
  483.  
  484. TYPE
  485.     NetworkSpec* = RECORD
  486.         charSet*:                CharacterSet;
  487.         dataLength*:                INTEGER;
  488.         body*:                    ARRAY (*ΔΔ[0..*)kNetworkSpecMaxBytes(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *) (* always fixed at the max size *)
  489.     END;
  490.  
  491.     NetworkSpecPtr* = POINTER TO NetworkSpec;
  492.  
  493. (**** PackedPathName ****)
  494. (* struct PackedPathName is a maximum-sized structure.  Allocate one of
  495. these and it will hold any valid packed pathname. *)
  496.     PackedPathName* = RECORD
  497.         dataLength*:                INTEGER;
  498.         data*:                    ARRAY (*ΔΔ[0..*)kPathNameMaxBytes - 2(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *)
  499.     END;
  500.  
  501. (* struct ProtoPackedPathName is a minimum-sized structure.  Use this
  502. for a variable-length packed PathName. *)
  503.     ProtoPackedPathName* = RECORD
  504.         dataLength*:                INTEGER;
  505.     END;
  506.  
  507.     PackedPathNamePtr* = POINTER TO PackedPathName;
  508.  
  509.     ProtoPackedPathNamePtr* = POINTER TO ProtoPackedPathName;
  510.  
  511. (*
  512. Copy the contents of path1 to path2.  path2Length is the size of path2, and must
  513. be large enough to hold a copy of path1.  A memFull error will be returned if that
  514. is not the case.
  515. *)
  516.  
  517. PROCEDURE OCECopyPackedPathName*((*CONST*)VAR path1: PackedPathName; VAR path2: PackedPathName; path2Length: INTEGER): Types.OSErr;
  518.     (*$IF NOT GENERATINGCFM*)
  519.     INLINE PASCAL $303C, 772, $AA5C;
  520.     (*$END*)
  521. (*
  522. Returns true if packed path pointer is nil, or is of zero length, or is of
  523. length 2 and nParts of zero.
  524. *)
  525. PROCEDURE OCEIsNullPackedPathName*((*CONST*)VAR path: PackedPathName): BOOLEAN;
  526.     (*$IF NOT GENERATINGCFM*)
  527.     INLINE PASCAL $303C, 797, $AA5C;
  528.     (*$END*)
  529. (*
  530. OCEUnpackPathName breaks apart the path into its component RStrings, writing string
  531. pointers into the array 'parts', which the client asserts can hold as many as
  532. 'nParts' elements. The number of parts actually found is returned.  Strings are
  533. placed in the array in order from lowest to highest.  The first pathName element
  534. beneath the root appears last.  NOTE THAT THE UN(*ΔΔPACKEDΔΔ*) STRUCT CONTAINS POINTERS INTO
  535. THE (*ΔΔPACKEDΔΔ*) STRUCT - DON'T DELETE OR REUSE THE (*ΔΔPACKEDΔΔ*) STRUCT UNTIL YOU ARE FINISHED
  536. WITH THE UN(*ΔΔPACKEDΔΔ*) STRUCT AS WELL
  537. *)
  538. PROCEDURE OCEUnpackPathName*((*CONST*)VAR path: PackedPathName; VAR parts: RStringPtr; nParts: INTEGER): INTEGER;
  539.     (*$IF NOT GENERATINGCFM*)
  540.     INLINE PASCAL $303C, 816, $AA5C;
  541.     (*$END*)
  542. PROCEDURE OCEPackedPathNameSize*((*CONST*)VAR parts: RStringPtr; nParts: INTEGER): INTEGER;
  543.     (*$IF NOT GENERATINGCFM*)
  544.     INLINE PASCAL $303C, 808, $AA5C;
  545.     (*$END*)
  546. PROCEDURE OCEDNodeNameCount*((*CONST*)VAR path: PackedPathName): INTEGER;
  547.     (*$IF NOT GENERATINGCFM*)
  548.     INLINE PASCAL $303C, 812, $AA5C;
  549.     (*$END*)
  550. (*
  551. OCEPackPathName packs the parts into the storage provided as LONG("path").  path must be
  552. large enough to hold the packed pathname.  A memFull error will be returned if
  553. pathLength is too small.  parts[0] should contain the deepest pathName element,
  554. and parts[nParts - 1] should contain the name of the first pathName element beneath
  555. the root. 
  556. *)
  557. PROCEDURE OCEPackPathName*(VAR parts: RStringPtr; nParts: INTEGER; VAR path: PackedPathName; pathLength: INTEGER): Types.OSErr;
  558.     (*$IF NOT GENERATINGCFM*)
  559.     INLINE PASCAL $303C, 803, $AA5C;
  560.     (*$END*)
  561. PROCEDURE OCEEqualPackedPathName*((*CONST*)VAR path1: PackedPathName; (*CONST*)VAR path2: PackedPathName): BOOLEAN;
  562.     (*$IF NOT GENERATINGCFM*)
  563.     INLINE PASCAL $303C, 785, $AA5C;
  564.     (*$END*)
  565. (*
  566. OCEValidPackedPathName checks that the packed PathName is internally consistent.
  567. Returns true if it's ok.
  568. *)
  569. PROCEDURE OCEValidPackedPathName*((*CONST*)VAR path: PackedPathName): BOOLEAN;
  570.     (*$IF NOT GENERATINGCFM*)
  571.     INLINE PASCAL $303C, 820, $AA5C;
  572.     (*$END*)
  573. (**** DirDiscriminator ****)
  574.  
  575. TYPE
  576.     DirDiscriminator* = RECORD
  577.         signature*:                OCEDirectoryKind;
  578.         misc*:                    LONGINT;
  579.     END;
  580.  
  581. (* Copies the value of disc1 to disc2. *)
  582.  
  583. PROCEDURE OCECopyDirDiscriminator*((*CONST*)VAR disc1: DirDiscriminator; VAR disc2: DirDiscriminator);
  584.     (*$IF NOT GENERATINGCFM*)
  585.     INLINE PASCAL $303C, 769, $AA5C;
  586.     (*$END*)
  587. (* Check the equality of two DirDiscriminators. *)
  588. PROCEDURE OCEEqualDirDiscriminator*((*CONST*)VAR disc1: DirDiscriminator; (*CONST*)VAR disc2: DirDiscriminator): BOOLEAN;
  589.     (*$IF NOT GENERATINGCFM*)
  590.     INLINE PASCAL $303C, 781, $AA5C;
  591.     (*$END*)
  592. (*
  593. This structure is called RLI because it really contains all the info you
  594. need to locate a record within the entire name space.  It contains four fields.
  595. The first two are the name of the catalog and a catalog discriminator.  These
  596. two fields are used to indicate to which catalog a given record belongs.  The
  597. discriminator is used to distinguish between two different catalogs that have
  598. the same name.
  599.  
  600. The other two fields in the RLI structure are used to indicate a particular
  601. catalog node within the catalog specified by the directoryName and
  602. discriminator fields.  These fields are exactly analagous to the dirID and
  603. pathname used in HFS.  It is possible to specify a dNode just by dNodeNumber
  604. (pathname is nil), or just by pathname (dNodeNumber is set to kNULLDNodeNumber),
  605. or by a combination of the two.  The latter is called a 'partial pathname', and
  606. while it is valid in the Catalog Manager API, it is not supported by ADAP
  607. catalogs in Release 1.
  608.  
  609. Note that the path parameter does not include the catalog name, but holds
  610. the names of all the nodes on the path to the desired catalog node, starting
  611. with the catalog node and working its way up the tree.
  612. *)
  613. (**** RLI ****)
  614.  
  615. TYPE
  616.     DirectoryName* = RECORD
  617.         charSet*:                CharacterSet;
  618.         dataLength*:                INTEGER;
  619.         body*:                    ARRAY (*ΔΔ[0..*)kDirectoryNameMaxBytes(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *) (* space for catalog name *)
  620.     END;
  621.  
  622.     DirectoryNamePtr* = POINTER TO DirectoryName;
  623.  
  624. (* Catalog node number *)
  625.     DNodeNum* = LONGINT;
  626.  
  627.     RLI* = RECORD
  628.         directoryName*:            DirectoryNamePtr;                        (* pointer to the name of the catalog root *)
  629.         discriminator*:            DirDiscriminator;                        (* used to discriminate between dup catalog names *)
  630.         dNodeNumber*:            DNodeNum;                                (* number of the node *)
  631.         path*:                    PackedPathNamePtr;                        (* old-style RLI *)
  632.     END;
  633.  
  634.     RLIPtr* = POINTER TO RLI;
  635.  
  636. (*
  637. Create a new RLI from the catalog name, discriminator, DNode number, and
  638. PackedPathName.  You must allocate the storage for the RLI and pass in a pointer
  639. to it.
  640. *)
  641.  
  642. PROCEDURE OCENewRLI*(VAR newRLI: RLI; (*CONST*)VAR dirName: DirectoryName; VAR discriminator: DirDiscriminator; dNodeNumber: DNodeNum; (*CONST*)VAR path: PackedPathName);
  643.     (*$IF NOT GENERATINGCFM*)
  644.     INLINE PASCAL $303C, 799, $AA5C;
  645.     (*$END*)
  646. (*
  647. Duplicate the contents of rli1 to rli2.  No errors are returned. This
  648. simply copies the pointers to the catalog name and path, wiping out any pointer
  649. that you might have had in there.
  650. *)
  651. PROCEDURE OCEDuplicateRLI*((*CONST*)VAR rli1: RLI; VAR rli2: RLI);
  652.     (*$IF NOT GENERATINGCFM*)
  653.     INLINE PASCAL $303C, 779, $AA5C;
  654.     (*$END*)
  655. (*
  656. Copy the contents of rli1 to rli2.  rli2 must already contain
  657. pointers to structures large enough to hold copies of the corresponding
  658. fields from rli1.  A memFull error will be returned if that is not the case.
  659. So if you allocate a brand new empty destination, you must at least set up
  660. its length fields.
  661. *)
  662. PROCEDURE OCECopyRLI*((*CONST*)VAR rli1: RLI; VAR rli2: RLI): Types.OSErr;
  663.     (*$IF NOT GENERATINGCFM*)
  664.     INLINE PASCAL $303C, 775, $AA5C;
  665.     (*$END*)
  666. (*
  667. Check the equality of two RLIs.  This will take into account differences
  668. in the case and diacriticals of the directoryName and the PathName.
  669. NOTE THAT THIS WILL FAIL IF rli1 CONTAINS A DNODENUMBER AND A NIL PATHNAME,
  670. AND rli2 CONTAINS kNULLDNodeNumber AND A NON-NIL PATHNAME.  IN OTHER WORDS,
  671. THE TWO rlis MUST BE OF THE SAME FORM TO CHECK FOR EQUALITY.
  672. The one exception is that if the pathname is nil, a dNodeNumber of zero and
  673. kRootDNodeNumber will be treated as equal.
  674. *)
  675. PROCEDURE OCEEqualRLI*((*CONST*)VAR rli1: RLI; (*CONST*)VAR rli2: RLI): BOOLEAN;
  676.     (*$IF NOT GENERATINGCFM*)
  677.     INLINE PASCAL $303C, 789, $AA5C;
  678.     (*$END*)
  679. (*
  680. Check the validity of an RLI.  This checks that the catalog name length
  681. is within bounds, and the packed pathname (if specified) is valid.
  682. *)
  683. PROCEDURE OCEValidRLI*((*CONST*)VAR theRLI: RLI): BOOLEAN;
  684.     (*$IF NOT GENERATINGCFM*)
  685.     INLINE PASCAL $303C, 823, $AA5C;
  686.     (*$END*)
  687. (**** PackedRLI ****)
  688. (*
  689. struct PackedRLI is a maximum-sized structure.  Allocate one of
  690. these and it will hold any valid packed pathname.
  691. *)
  692.  
  693. CONST
  694.     kRLIMaxBytes*                = SIZE (*ΔΔ sizeof*)(RString) + SIZE (*ΔΔ sizeof*)(DirDiscriminator) + SIZE (*ΔΔ sizeof*)(DNodeNum) + kPathNameMaxBytes;
  695.  
  696.  
  697. TYPE
  698.     PackedRLI* = RECORD
  699.         dataLength*:                INTEGER;
  700.         data*:                    ARRAY (*ΔΔ[0..*)kRLIMaxBytes(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *)
  701.     END;
  702.  
  703. (*
  704. struct ProtoPackedRLI is a minimum-sized structure.  Use this
  705. for a variable-length packed RLI.
  706. *)
  707.     ProtoPackedRLI* = RECORD
  708.         dataLength*:                INTEGER;
  709.     END;
  710.  
  711.     PackedRLIPtr* = POINTER TO PackedRLI;
  712.  
  713.     ProtoPackedRLIPtr* = POINTER TO ProtoPackedRLI;
  714.  
  715. (*
  716. Copy the contents of prli1 to prli2.  prli2Length is the size of prli2, and must
  717. be large enough to hold a copy of prli1.  A memFull error will be returned if that
  718. is not the case.
  719. *)
  720.  
  721. PROCEDURE OCECopyPackedRLI*((*CONST*)VAR prli1: PackedRLI; VAR prli2: PackedRLI; prli2Length: INTEGER): Types.OSErr;
  722.     (*$IF NOT GENERATINGCFM*)
  723.     INLINE PASCAL $303C, 773, $AA5C;
  724.     (*$END*)
  725. (*
  726. OCEUnpackRLI breaks apart the prli into its components, writing pointers into
  727. the rli structure.  NOTE THAT THE UN(*ΔΔPACKEDΔΔ*) STRUCT CONTAINS POINTERS INTO THE
  728. (*ΔΔPACKEDΔΔ*) STRUCT - DON'T DELETE OR REUSE THE (*ΔΔPACKEDΔΔ*) STRUCT UNTIL YOU ARE FINISHED
  729. WITH THE UN(*ΔΔPACKEDΔΔ*) STRUCT AS WELL
  730. *)
  731. PROCEDURE OCEUnpackRLI*((*CONST*)VAR prli: PackedRLI; VAR theRLI: RLI);
  732.     (*$IF NOT GENERATINGCFM*)
  733.     INLINE PASCAL $303C, 817, $AA5C;
  734.     (*$END*)
  735. (*
  736. OCEPackedRLISize computes the number of bytes of memory needed to hold a
  737. PackedRLI manufactured from an RLI.  This length
  738. includes the length of the length field of PackedRLI, so it
  739. is safe to do a NewPtr (OCEPackedRLISize(...)).
  740. *)
  741. PROCEDURE OCEPackedRLISize*((*CONST*)VAR theRLI: RLI): INTEGER;
  742.     (*$IF NOT GENERATINGCFM*)
  743.     INLINE PASCAL $303C, 810, $AA5C;
  744.     (*$END*)
  745. (*
  746. OCEPackRLI packs the RLI into the storage provided as LONG("prli").  prli must be
  747. large enough to hold the packed RLI.  A memFull error will be returned if
  748. prliLength is too small.
  749. *)
  750. PROCEDURE OCEPackRLI*((*CONST*)VAR theRLI: RLI; VAR prli: PackedRLI; prliLength: INTEGER): Types.OSErr;
  751.     (*$IF NOT GENERATINGCFM*)
  752.     INLINE PASCAL $303C, 804, $AA5C;
  753.     (*$END*)
  754. (*
  755. OCEPackedRLIPartsSize computes the number of bytes of memory needed to hold a
  756. PackedRLI manufactured from the parts of an RLI.  This length
  757. includes the length of the length field of PackedRLI, so it
  758. is safe to do a NewPtr (OCEPackedRLIPartsSize(...)).
  759. *)
  760. PROCEDURE OCEPackedRLIPartsSize*((*CONST*)VAR dirName: DirectoryName; VAR parts: RStringPtr; nParts: INTEGER): INTEGER;
  761.     (*$IF NOT GENERATINGCFM*)
  762.     INLINE PASCAL $303C, 809, $AA5C;
  763.     (*$END*)
  764. PROCEDURE OCEPackRLIParts*((*CONST*)VAR dirName: DirectoryName; (*CONST*)VAR discriminator: DirDiscriminator; dNodeNumber: DNodeNum; VAR parts: RStringPtr; nParts: INTEGER; VAR prli: PackedRLI; prliLength: INTEGER): Types.OSErr;
  765.     (*$IF NOT GENERATINGCFM*)
  766.     INLINE PASCAL $303C, 805, $AA5C;
  767.     (*$END*)
  768. PROCEDURE OCEEqualPackedRLI*((*CONST*)VAR prli1: PackedRLI; (*CONST*)VAR prli2: PackedRLI): BOOLEAN;
  769.     (*$IF NOT GENERATINGCFM*)
  770.     INLINE PASCAL $303C, 787, $AA5C;
  771.     (*$END*)
  772. (*
  773. Check the validity of a packed RLI.  This checks that the catalog name length
  774. is within bounds, and the packed pathname (if specified) is valid.
  775. *)
  776. PROCEDURE OCEValidPackedRLI*((*CONST*)VAR prli: PackedRLI): BOOLEAN;
  777.     (*$IF NOT GENERATINGCFM*)
  778.     INLINE PASCAL $303C, 822, $AA5C;
  779.     (*$END*)
  780. (*
  781. If this packed RLI describes a Personal Catalog, this call will return a pointer
  782. to an alias record that can be used to find the actual file.  Otherwise, it returns nil.
  783. *)
  784. PROCEDURE OCEExtractAlias*((*CONST*)VAR prli: PackedRLI): Aliases.AliasPtr;
  785.     (*$IF NOT GENERATINGCFM*)
  786.     INLINE PASCAL $303C, 792, $AA5C;
  787.     (*$END*)
  788. (*
  789. This call returns a pointer to a packed RLI that represents the "Catalogs" icon, or
  790. the root of all catalogs.  It is used in the CollabPack.
  791. *)
  792. (*•• PROCEDURE OCEGetDirectoryRootPackedRLI*(): PackedRLI;
  793.     (*$IF NOT GENERATINGCFM*)
  794.     INLINE PASCAL $303C, 838, $AA5C;
  795.     (*$END*)*)
  796. (**** LocalRecordID ****)
  797.  
  798. TYPE
  799.     LocalRecordID* = RECORD
  800.         cid*:                    CreationID;
  801.         recordName*:                RStringPtr;
  802.         recordType*:                RStringPtr;
  803.     END;
  804.  
  805.     LocalRecordIDPtr* = POINTER TO LocalRecordID;
  806.  
  807. (* Create a LocalRecordID from a name, type, and CreationID *)
  808.  
  809. PROCEDURE OCENewLocalRecordID*((*CONST*)VAR recordName: RString; (*CONST*)VAR recordType: RString; (*CONST*)VAR cid: CreationID; VAR lRID: LocalRecordID);
  810.     (*$IF NOT GENERATINGCFM*)
  811.     INLINE PASCAL $303C, 798, $AA5C;
  812.     (*$END*)
  813. (*
  814. Copy LocalRecordID lRID1 to LocalRecordID lRID2.  lRID2 must already contain
  815. pointers to RString structures large enough to hold copies of the corresponding
  816. fields from lRID1.  A memFull error will be returned if that is not the case.
  817. So if you allocate a brand new empty destination, you must at least set up
  818. its length field.
  819. *)
  820. PROCEDURE OCECopyLocalRecordID*((*CONST*)VAR lRID1: LocalRecordID; VAR lRID2: LocalRecordID): Types.OSErr;
  821.     (*$IF NOT GENERATINGCFM*)
  822.     INLINE PASCAL $303C, 770, $AA5C;
  823.     (*$END*)
  824. (*
  825. Check the equality of two local RIDs.
  826. *)
  827. PROCEDURE OCEEqualLocalRecordID*((*CONST*)VAR lRID1: LocalRecordID; (*CONST*)VAR lRID2: LocalRecordID): BOOLEAN;
  828.     (*$IF NOT GENERATINGCFM*)
  829.     INLINE PASCAL $303C, 783, $AA5C;
  830.     (*$END*)
  831. (**** ShortRecordID ****)
  832.  
  833. TYPE
  834.     ShortRecordID* = RECORD
  835.         rli*:                    PackedRLIPtr;
  836.         cid*:                    CreationID;
  837.     END;
  838.  
  839.     ShortRecordIDPtr* = POINTER TO ShortRecordID;
  840.  
  841. (* Create a ShortRecordID from an RLI struct and a CreationID *)
  842.  
  843. PROCEDURE OCENewShortRecordID*((*CONST*)VAR theRLI: PackedRLI; (*CONST*)VAR cid: CreationID; sRID: ShortRecordIDPtr);
  844.     (*$IF NOT GENERATINGCFM*)
  845.     INLINE PASCAL $303C, 801, $AA5C;
  846.     (*$END*)
  847. (*
  848. Copy ShortRecordID sRID1 to ShortRecordID sRID2.  sRID2 must already contain
  849. pointers to structures large enough to hold copies of the corresponding
  850. fields from sRID1.  A memFull error will be returned if that is not the case.
  851. So if you allocate a brand new empty destination, you must at least set up
  852. its length fields.
  853. *)
  854. PROCEDURE OCECopyShortRecordID*((*CONST*)VAR sRID1: ShortRecordID; VAR sRID2: ShortRecordID): Types.OSErr;
  855.     (*$IF NOT GENERATINGCFM*)
  856.     INLINE PASCAL $303C, 778, $AA5C;
  857.     (*$END*)
  858. (*
  859. Check the equality of two short RIDs.
  860. *)
  861. PROCEDURE OCEEqualShortRecordID*((*CONST*)VAR sRID1: ShortRecordID; (*CONST*)VAR sRID2: ShortRecordID): BOOLEAN;
  862.     (*$IF NOT GENERATINGCFM*)
  863.     INLINE PASCAL $303C, 791, $AA5C;
  864.     (*$END*)
  865. (**** RecordID ****)
  866.  
  867. TYPE
  868.     RecordID* = RECORD
  869.         rli*:                    PackedRLIPtr;                            (* pointer to a packed rli structure *)
  870.         local*:                    LocalRecordID;
  871.     END;
  872.  
  873.     RecordIDPtr* = POINTER TO RecordID;
  874.  
  875. (*    Create a RecordID from a packed RLI struct and a LocalRecordID.
  876. This doesn't allocate any new space; the RecordID points to the same
  877. packed RLI struct and the same name and type RStrings. *)
  878.  
  879. PROCEDURE OCENewRecordID*((*CONST*)VAR theRLI: PackedRLI; (*CONST*)VAR lRID: LocalRecordID; VAR rid: RecordID);
  880.     (*$IF NOT GENERATINGCFM*)
  881.     INLINE PASCAL $303C, 800, $AA5C;
  882.     (*$END*)
  883. (*
  884. Copy RecordID RID1 to RecordID RID2.  RID2 must already contain
  885. pointers to structures large enough to hold copies of the corresponding
  886. fields from lRID1.  A memFull error will be returned if that is not the case.
  887. So if you allocate a brand new empty destination, you must at least set up
  888. its length fields.
  889. *)
  890. PROCEDURE OCECopyRecordID*((*CONST*)VAR rid1: RecordID; (*CONST*)VAR rid2: RecordID): Types.OSErr;
  891.     (*$IF NOT GENERATINGCFM*)
  892.     INLINE PASCAL $303C, 777, $AA5C;
  893.     (*$END*)
  894. (*    Check the equality of two RIDs. *)
  895. PROCEDURE OCEEqualRecordID*((*CONST*)VAR rid1: RecordID; (*CONST*)VAR rid2: RecordID): BOOLEAN;
  896.     (*$IF NOT GENERATINGCFM*)
  897.     INLINE PASCAL $303C, 788, $AA5C;
  898.     (*$END*)
  899. (**** PackedRecordID ****)
  900. (*
  901. struct PackedRecordID is a maximum-sized structure.  Allocate one of
  902. these and it will hold any valid packed RecordID.
  903. *)
  904.  
  905. CONST
  906.     kPackedRecordIDMaxBytes*        = kPathNameMaxBytes + SIZE (*ΔΔ sizeof*)(DNodeNum) + SIZE (*ΔΔ sizeof*)(DirDiscriminator) + SIZE (*ΔΔ sizeof*)(CreationID) + (3 * SIZE (*ΔΔ sizeof*)(RString));
  907.  
  908.  
  909. TYPE
  910.     PackedRecordID* = RECORD
  911.         dataLength*:                INTEGER;
  912.         data*:                    ARRAY (*ΔΔ[0..*)kPackedRecordIDMaxBytes(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *)
  913.     END;
  914.  
  915. (*
  916. struct ProtoPackedRecordID is a minimum-sized structure.  Use this
  917. for a variable-length packed RecordID.
  918. *)
  919.     ProtoPackedRecordID* = RECORD
  920.         dataLength*:                INTEGER;
  921.     END;
  922.  
  923.     PackedRecordIDPtr* = POINTER TO PackedRecordID;
  924.  
  925.     ProtoPackedRecordIDPtr* = POINTER TO ProtoPackedRecordID;
  926.  
  927. (*
  928. Copy PackedRecordID pRID1 to PackedRecordID pRID2.  pRID2 must already contain
  929. pointers to structures large enough to hold copies of the corresponding
  930. fields from pRID1.  A memFull error will be returned if that is not the case.
  931. pRID2Length is the number of bytes that can be put into pRID2, not counting the
  932. packed RecordID header.
  933. *)
  934.  
  935. PROCEDURE OCECopyPackedRecordID*((*CONST*)VAR pRID1: PackedRecordID; (*CONST*)VAR pRID2: PackedRecordID; pRID2Length: INTEGER): Types.OSErr;
  936.     (*$IF NOT GENERATINGCFM*)
  937.     INLINE PASCAL $303C, 774, $AA5C;
  938.     (*$END*)
  939. (*
  940. Create a RecordID from a PackedRecordID.
  941. NOTE THAT THE UN(*ΔΔPACKEDΔΔ*) STRUCT CONTAINS POINTERS INTO THE (*ΔΔPACKEDΔΔ*) STRUCT - DON'T DELETE
  942. OR REUSE THE (*ΔΔPACKEDΔΔ*) STRUCT UNTIL YOU ARE FINISHED WITH THE UN(*ΔΔPACKEDΔΔ*) STRUCT AS WELL
  943. *)
  944. PROCEDURE OCEUnpackRecordID*((*CONST*)VAR pRID: PackedRecordID; VAR rid: RecordID);
  945.     (*$IF NOT GENERATINGCFM*)
  946.     INLINE PASCAL $303C, 818, $AA5C;
  947.     (*$END*)
  948. (*
  949. Create a PackedRecordID from a RecordID.  pRID must be large enough to contain
  950. the packed RecordID.  A memFull error will be returned if that is not the case.
  951. packedRecordIDLength is the number of bytes that can be put into pRID, not
  952. counting the header.
  953. *)
  954. PROCEDURE OCEPackRecordID*((*CONST*)VAR rid: RecordID; VAR pRID: PackedRecordID; packedRecordIDLength: INTEGER): Types.OSErr;
  955.     (*$IF NOT GENERATINGCFM*)
  956.     INLINE PASCAL $303C, 806, $AA5C;
  957.     (*$END*)
  958. (*
  959. Compute the number of bytes of memory needed to hold a RecordID when packed. This
  960. length includes the length of the length field of PackedRecordID, so it
  961. is safe to do a NewPtr (OCEPackedRecordIDSize(...)).
  962. *)
  963. PROCEDURE OCEPackedRecordIDSize*((*CONST*)VAR rid: RecordID): INTEGER;
  964.     (*$IF NOT GENERATINGCFM*)
  965.     INLINE PASCAL $303C, 811, $AA5C;
  966.     (*$END*)
  967. (*
  968. Check the equality of two packed RIDs.
  969. *)
  970. PROCEDURE OCEEqualPackedRecordID*((*CONST*)VAR pRID1: PackedRecordID; (*CONST*)VAR pRID2: PackedRecordID): BOOLEAN;
  971.     (*$IF NOT GENERATINGCFM*)
  972.     INLINE PASCAL $303C, 786, $AA5C;
  973.     (*$END*)
  974. (* OCEValidPackedRecordID checks the validity of a packed record AIFF.ID. *)
  975. PROCEDURE OCEValidPackedRecordID*((*CONST*)VAR pRID: PackedRecordID): BOOLEAN;
  976.     (*$IF NOT GENERATINGCFM*)
  977.     INLINE PASCAL $303C, 821, $AA5C;
  978.     (*$END*)
  979. (**** DSSpec ****)
  980.  
  981. TYPE
  982.     DSSpec* = RECORD
  983.         entitySpecifier*:        POINTER TO RecordID;
  984.         extensionType*:            Types.OSType;
  985.         extensionSize*:            INTEGER;
  986.         extensionValue*:            Types.Ptr;
  987.     END;
  988.  
  989.     DSSpecPtr* = POINTER TO DSSpec;
  990.  
  991. (*
  992. struct PackedDSSpec is NOT a maximum-sized structure.  Allocate one of
  993. these and it will hold any valid packed RecordID, but not necessarily any additional
  994. data.
  995. *)
  996.  
  997. CONST
  998.     kPackedDSSpecMaxBytes*        = SIZE (*ΔΔ sizeof*)(PackedRecordID) + SIZE (*ΔΔ sizeof*)(Types.OSType) + SIZE (*ΔΔ sizeof*)(Types.UInt16);
  999.  
  1000.  
  1001. TYPE
  1002.     PackedDSSpec* = RECORD
  1003.         dataLength*:                INTEGER;
  1004.         data*:                    ARRAY (*ΔΔ[0..*)kPackedDSSpecMaxBytes(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *)
  1005.     END;
  1006.  
  1007. (*
  1008. struct ProtoPackedDSSpec is a minimum-sized structure.  Use this
  1009. for a variable-length packed DSSpec.
  1010. *)
  1011.     ProtoPackedDSSpec* = RECORD
  1012.         dataLength*:                INTEGER;
  1013.     END;
  1014.  
  1015.     PackedDSSpecPtr* = POINTER TO PackedDSSpec;
  1016.  
  1017.     ProtoPackedDSSpecPtr* = POINTER TO ProtoPackedDSSpec;
  1018.  
  1019. (*
  1020. Copy PackedDSSpec pdss1 to PackedDSSpec pdss2.  pdss2 must already contain
  1021. pointers to structures large enough to hold copies of the corresponding
  1022. fields from pdss1.  A memFull error will be returned if that is not the case.
  1023. pdss2Length is the number of bytes that can be put into pdss2, not counting the
  1024. packed DSSpec header.
  1025. *)
  1026.  
  1027. PROCEDURE OCECopyPackedDSSpec*((*CONST*)VAR pdss1: PackedDSSpec; (*CONST*)VAR pdss2: PackedDSSpec; pdss2Length: INTEGER): Types.OSErr;
  1028.     (*$IF NOT GENERATINGCFM*)
  1029.     INLINE PASCAL $303C, 771, $AA5C;
  1030.     (*$END*)
  1031. (*
  1032. Create a DSSpec from a PackedDSSpec.
  1033. NOTE THAT THE UN(*ΔΔPACKEDΔΔ*) STRUCT CONTAINS POINTERS INTO THE (*ΔΔPACKEDΔΔ*) STRUCT - DON'T DELETE
  1034. OR REUSE THE (*ΔΔPACKEDΔΔ*) STRUCT UNTIL YOU ARE FINISHED WITH THE UN(*ΔΔPACKEDΔΔ*) STRUCT AS WELL.
  1035. A pointer to the extension is returned in dss->extensionValue, and the length of that
  1036. extension is returned in dss->extensionSize.  If there is no extension, dss->extensionValue will
  1037. be set to nil.  This routine will unpack the RecordID (if any) into rid, unpack the rest
  1038. into dss, and set dss->entitySpecifier to rid.
  1039. *)
  1040. PROCEDURE OCEUnpackDSSpec*((*CONST*)VAR pdss: PackedDSSpec; VAR dss: DSSpec; VAR rid: RecordID);
  1041.     (*$IF NOT GENERATINGCFM*)
  1042.     INLINE PASCAL $303C, 815, $AA5C;
  1043.     (*$END*)
  1044. (*
  1045. Create a PackedDSSpec from a DSSpec.  pdss must be large enough to
  1046. contain the packed RecordID and any extension.  A memFull error will be returned if that
  1047. is not the case.  pdssLength is the number of bytes that can be put into pdss,
  1048. not counting the header.
  1049. *)
  1050. PROCEDURE OCEPackDSSpec*((*CONST*)VAR dss: DSSpec; VAR pdss: PackedDSSpec; pdssLength: INTEGER): Types.OSErr;
  1051.     (*$IF NOT GENERATINGCFM*)
  1052.     INLINE PASCAL $303C, 802, $AA5C;
  1053.     (*$END*)
  1054. (*
  1055. Compute the number of bytes of memory needed to hold a DSSpec when packed. This
  1056. length includes the length of the length field of PackedDSSpec, so it
  1057. is safe to do a NewPtr (OCEPackedDSSpecSize(...)).
  1058. *)
  1059. PROCEDURE OCEPackedDSSpecSize*((*CONST*)VAR dss: DSSpec): INTEGER;
  1060.     (*$IF NOT GENERATINGCFM*)
  1061.     INLINE PASCAL $303C, 807, $AA5C;
  1062.     (*$END*)
  1063. (*    Check the equality of two DSSpecs.  This compares all fields, even the
  1064. extension (unless extensionSize == 0).  The extensions are compared in a case-insensitive and
  1065. diacrit-insensitive manner. *)
  1066. PROCEDURE OCEEqualDSSpec*((*CONST*)VAR pdss1: DSSpec; (*CONST*)VAR pdss2: DSSpec): BOOLEAN;
  1067.     (*$IF NOT GENERATINGCFM*)
  1068.     INLINE PASCAL $303C, 782, $AA5C;
  1069.     (*$END*)
  1070. (*    Check the equality of two PackedDSSpecs.  This compares all fields, even the
  1071. extension (unless extensionSize == 0).  The extensions are compared in a case-insensitive and
  1072. diacrit-insensitive manner. *)
  1073. PROCEDURE OCEEqualPackedDSSpec*((*CONST*)VAR pdss1: PackedDSSpec; (*CONST*)VAR pdss2: PackedDSSpec): BOOLEAN;
  1074.     (*$IF NOT GENERATINGCFM*)
  1075.     INLINE PASCAL $303C, 784, $AA5C;
  1076.     (*$END*)
  1077. (*
  1078. Check the validity of a PackedDSSpec.  If extensionType is
  1079. LONG("entn"), pdss must contain a valid entitySpecifier.  For all other extensionTypes, a nil
  1080. entitySpecifier is valid, but if non-nil, it will be checked for validity.  No check
  1081. is made on the extension.
  1082. *)
  1083. PROCEDURE OCEValidPackedDSSpec*((*CONST*)VAR pdss: PackedDSSpec): BOOLEAN;
  1084.     (*$IF NOT GENERATINGCFM*)
  1085.     INLINE PASCAL $303C, 819, $AA5C;
  1086.     (*$END*)
  1087. (*
  1088. Return info about a DSSpec.  This routine does not check validity.  If the
  1089. DSSpec has no extension, we determine whether it represents the root of all
  1090. catalogs, a single catalog, a DNode, or a Record.  Else it is invalid.
  1091. If the DSSpec has an extension, we simply return the extension type.
  1092. *)
  1093. PROCEDURE OCEGetDSSpecInfo*((*CONST*)VAR spec: DSSpec): Types.OSType;
  1094.     (*$IF NOT GENERATINGCFM*)
  1095.     INLINE PASCAL $303C, 793, $AA5C;
  1096.     (*$END*)
  1097. (* OCEGetExtensionType returns the extensionType imbedded in the PackedDSSpec. *)
  1098. PROCEDURE OCEGetExtensionType*((*CONST*)VAR pdss: PackedDSSpec): Types.OSType;
  1099.     (*$IF NOT GENERATINGCFM*)
  1100.     INLINE PASCAL $303C, 796, $AA5C;
  1101.     (*$END*)
  1102. (*
  1103. OCEStreamPackedDSSpec streams (flattens) a catalog object a little at a time by
  1104. calling the DSSpecStreamer routine that you provide.
  1105. *)
  1106. TYPE
  1107.     DSSpecStreamerProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (buffer: (*ΔΔUNIVΔΔ*) Types.Ptr; count: LONGINT; eof: BOOLEAN; userData: LONGINT): Types.OSErr;
  1108.     DSSpecStreamerUPP* = Types.UniversalProcPtr;
  1109.  
  1110. CONST
  1111.     uppDSSpecStreamerProcInfo* = $000037E0; (* PROCEDURE (4 byte param, 4 byte param, 1 byte param, 4 byte param): 2 byte result; *)
  1112.  
  1113. PROCEDURE NewDSSpecStreamerProc*(userRoutine: DSSpecStreamerProcPtr): DSSpecStreamerUPP;
  1114.     (*$IF NOT GENERATINGCFM *)
  1115.     INLINE PASCAL $2E9F;
  1116.     (*$END*)
  1117.  
  1118. PROCEDURE CallDSSpecStreamerProc*(buffer: (*ΔΔUNIVΔΔ*) Types.Ptr; count: LONGINT; eof: BOOLEAN; userData: LONGINT; userRoutine: DSSpecStreamerUPP): Types.OSErr;
  1119.     (*$IF NOT GENERATINGCFM*)
  1120.     INLINE PASCAL $205F, $4E90;
  1121.     (*$END*)
  1122.     
  1123. TYPE
  1124.     DSSpecStreamer* = DSSpecStreamerUPP;
  1125.  
  1126.  
  1127. PROCEDURE OCEStreamPackedDSSpec*((*CONST*)VAR dss: DSSpec; stream: DSSpecStreamer; userData: LONGINT; VAR actualCount: LONGINT): Types.OSErr;
  1128.     (*$IF NOT GENERATINGCFM*)
  1129.     INLINE PASCAL $303C, 829, $AA5C;
  1130.     (*$END*)
  1131. (**** AttributeType ****)
  1132. (*
  1133. For the record, an AttributeType is an RString with a smaller maximum size.
  1134. I don't just typedef it to an RString, because I want the definition of the AttributeType
  1135. struct to contain the max length, because I need to include it in the Attribute struct
  1136. below.  But it should be possible to typecast any AttributeType to an RString and use
  1137. all the RString utilities on it.
  1138. *)
  1139.  
  1140. TYPE
  1141.     AttributeType* = RECORD
  1142.         charSet*:                CharacterSet;
  1143.         dataLength*:                INTEGER;
  1144.         body*:                    ARRAY (*ΔΔ[0..*)kAttributeTypeMaxBytes(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *) (* always fixed at the max size *)
  1145.     END;
  1146.  
  1147.     AttributeTypePtr* = POINTER TO AttributeType;
  1148.  
  1149. (* Miscellaneous defines*:  (these cannot be made into enums) *)
  1150.  
  1151. CONST
  1152.     kMinPackedRStringLength*        = SIZE (*ΔΔ sizeof*)(ProtoRString);
  1153.  
  1154.     kMinPackedRLISize*            = SIZE (*ΔΔ sizeof*)(ProtoPackedRLI) + SIZE (*ΔΔ sizeof*)(DirDiscriminator) + SIZE (*ΔΔ sizeof*)(DNodeNum) + kMinPackedRStringLength + SIZE (*ΔΔ sizeof*)(ProtoPackedPathName);
  1155.  
  1156.     
  1157. TYPE
  1158.     AttributeTag* = AppleEvents.DescType;
  1159.  
  1160.     AttributeValue* = RECORD
  1161.         tag*:                    AttributeTag;
  1162.         dataLength*:                LONGINT;
  1163.         bytes*:                    Types.Ptr;
  1164.     END;
  1165.  
  1166.     AttributeValuePtr* = POINTER TO AttributeValue;
  1167.  
  1168. (**** Attribute ****)
  1169.     Attribute* = RECORD
  1170.         attributeType*:            AttributeType;
  1171.         cid*:                    AttributeCreationID;
  1172.         value*:                    AttributeValue;
  1173.     END;
  1174.  
  1175.     AttributePtr* = POINTER TO Attribute;
  1176.  
  1177.  
  1178. (*•• PROCEDURE OCEGetIndRecordType*(stringIndex: OCERecordTypeIndex): RString;
  1179.     (*$IF NOT GENERATINGCFM*)
  1180.     INLINE PASCAL $303C, 795, $AA5C;
  1181.     (*$END*)*)
  1182. (*•• PROCEDURE OCEGetIndAttributeType*(stringIndex: OCEAttributeTypeIndex): AttributeType;
  1183.     (*$IF NOT GENERATINGCFM*)
  1184.     INLINE PASCAL $303C, 794, $AA5C;
  1185.     (*$END*)*)
  1186.  
  1187. CONST
  1188.     _oceTBDispatch*                = $AA5E;
  1189.  
  1190.  
  1191. (* $ALIGN RESET*)
  1192. (* $POP*)
  1193.  
  1194.  END OCE.
  1195.